package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.SimplePropsDTO;
import com.sc.nft.entity.SecondEquityPropsConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.AdminSecondEquityPropsPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 二级-权益道具配置表(sc_second_equity_props_config)数据Mapper
 *
 * @author Sun
 * @since 2024-04-07 14:18:15
 * @description 由 Mybatisplus Code Generator 创建
*/
@Mapper
public interface SecondEquityPropsConfigMapper extends BaseMapper<SecondEquityPropsConfig> {

    /**
     * 分页查询
     * @param page
     * @param firstTitle
     * @return
     */
    Page<AdminSecondEquityPropsPageVO> getPage(Page page,@Param("firstTitle") String firstTitle);

    @Select("select id,first_title as name from sc_equity_props where id in (select equity_props_id from sc_second_equity_props_config where is_delete=0 and panel_id = #{panelId})")
    List<SimplePropsDTO> getPropsByPanelId(@Param("panelId") Long panelId);
}
